<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1, user-scalable=no" />
		<title></title>
		<link rel="stylesheet" href="css/menudown.css" />
		<link rel="stylesheet" href="css/search.css" />
		<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
		<script type="text/javascript" src="js/menudown.js" ></script>
		<style>
			.input_s2{
				width: 77%;
				height: 30px;
				background: #f4f4f4;
				color: black;
				margin-top: 9px;
				outline: 0;
				border: 0;
				text-align: center;
				font-size: 1rem;
			}
		</style>
	</head>
	<body>
		<div class="index_top">
			<div  class="top_left">
				<img class="l_img" src="image/index_image/back.png" alt="">
			</div>
			<div class="top_contant">
				<span class="moyu">魔域手游</span> <span class="koudai">魔域手游(口袋版)</span><!--需要做显示判断-->
			</div>
			<a class="top_right" href="person_center.html">
				我的
			</a>
		</div>
		<div class="header_top">
			<input placeholder="请输入游戏名称或商品标题" class="top_input"/>
			<div class="top_search" onclick="yes_submit()">搜索</div>
		</div>
		<div class="nav_nav">
			<dl class="topmenu">
				<dt>
					<div class="selectlist">
						<div class="select_textdiv">
							<input type="hidden" value=""/>
							<p class="s_text ppp type_one">选择机型</p><span class="down"><img src="image/index_image/down.png"></span>
						</div>
						<div class="select_textul">
							<ul class="select_first_ul">
								<li data-id="1" >
									<p class="p"><span class="p_span">安卓</span> </p>
								</li>
								<li data-id="2">
									<p class="p"><span class="p_span">苹果</span> </p>
								</li>
							</ul>
						</div>
					</div>
				</dt>
				<dt>
					<div class="selectlist">
						<div class="select_textdiv">
							<input type="hidden" value=""/>
							<p class="s_text ppp type_two" >商品类型</p><span class="down"><img src="image/index_image/down.png"></span>
						</div>
						<div class="select_textul">
							<ul class="select_first_ul">
								<li data-id="3">
									<p class="p" href="goods_detail.html"><span class="p_span">全部</span> </p>
								</li>
								<li data-id="4">
									<p class="p"><span class="p_span">账号</span> </p>
								</li>
								<li data-id="5">
									<p class="p"><span class="p_span">首充号</span> </p>
								</li>
								<li data-id="6">
									<p class="p"><span class="p_span">游戏币</span> </p>
								</li>
							</ul>
						</div>
					</div>
				</dt>
				<dt>
					<div class="selectlist">
						<div class="select_textdiv search_title">
							<input type="hidden" value=""/>
							<p class="s_text ppp fuwuqi_select type_three">服务器</p><span class="down"><img src="image/index_image/down.png"></span>
						</div>
						<div class="select_textul fuwuqi_div">
							<ul class="select_first_ul">
								<li>
									<p class="p"><span class="p_span all_service" data-id="4">全部客户端1</span> </p>
									<ul class="select_second_ul"  style="display: block;">
										<li>
											<div class="search_div_d">
												<input class="input_s2">
												<span class="search_txt_s2">搜索</span>
											</div>
											<ul class="result_ul ul_li2">
												<li data-id="1666">全部客户端1</li>
												<li data-id="17777">全部客户端2</li>
												<li data-id="1888">全部客户端3</li>
											</ul>
										</li>
									</ul>
								</li>
								<li>
									<p class="p"><span class="p_span all_service" data-id="3">牛牛客户端2</span> </p>
									<ul class="select_second_ul">
										<li>
											<div class="search_div_d">
													<input type="text" class="input_s">
												<span class="search_txt_s2">搜索</span>
											</div>
												<ul class="result_ul ul_li2">
													<li data-id="2666">牛牛服务区1</li>
													<li data-id="2777">牛牛服务区2</li>
													<li data-id="2888">牛牛服务区3</li>
												</ul>
										</li>
									</ul>
								</li>
							</ul>
						</div>
					</div>
				</dt>
				<dt>
					<div class="selectlist">
						<div class="select_textdiv">
							<input type="hidden" value=""/>
							<p class="s_text ppp type_four">筛选排序</p><span class="down"><img src="image/index_image/down.png"></span>
						</div>
						<div class="select_textul select_div">
							<ul class="select_first_ul jjjj">
								<li>
									<div class="price_choose">
										<div class="price_choose_input">
											<span class="choose_span">价格区间</span>
											<input   class="choose_input_s pppp" placeholder="最低价格" type="number">
											<span>--</span>
											<input  class="choose_input_s2 pppp2" placeholder="最高价格" type="number">
										</div>
										<div class="price_choose_btn">
											<button class="price_item"><span class="low_price">0</span>~<span class="high_price">30</span></button>
											<button class="price_item"><span class="low_price">30</span>~<span class="high_price">100</span></button>
											<button class="price_item"><span class="low_price">100</span>~<span class="high_price">200</span></button>
											<button class="price_item"><span class="low_price">200</span>~<span class="high_price">500</span></button>
											<button class="price_item"><span class="low_price">500</span>~<span class="high_price">1000</span></button>
											<button class="price_item"><span class="low_price hhh">2000</span>~以上<span class="high_price"></span></button>
										</div>
									</div>
								</li>
								<li class="paixu">
									<li class="p22 bgbg_bg"><span class="p_span">按时间顺序</span> </li>
									<li class="p22"><span class="p_span">价格从高到底</span> </li>
									<li class="p22"><span class="p_span">价格从低到高</span> </li>
								</li>
								<li>
									<div class="yes_comfirm" onclick="yes_submit()">确定</div>
								</li>
							</ul>
						</div>
					</div>
				</dt>
			</dl>
		</div>
		<div class="mengcen_s"></div>
		<div class="game_list">
			<div class="game_list_list">
				<a class="game_list_item" href="goods_detail.html">
					<div class="game_list_item_l">
							<img class="game_list_item_l_box"  src="./image/index_image/icon.png" alt="">
					</div>
					<div class="game_list_item_c">
						<div class="game_list_item_c_s">
							<span class="chong_bg">首充号</span>充2000元带奖励可代续充
						</div>
						<div class="game_list_item_c_z">安卓牛牛|神域之光|魔域手游</div>
						<div class="game_list_item_c_x">￥1800</div>
					</div>
				</a>
				<a class="game_list_item" href="goods_detail.html">
					<div class="game_list_item_l">
						<div class="game_list_item_l">
							<img class="game_list_item_l_box"  src="./image/index_image/icon.png" alt="">
						</div>
					</div>
					<div class="game_list_item_c">
						<div class="game_list_item_c_s">
							<span class="chong_bg2">魔石</span>充2000元带奖励可代续充
						</div>
						<div class="game_list_item_c_z">安卓牛牛|神域之光|魔域手游</div>
						<div class="game_list_item_c_x">￥1800</div>
					</div>
				</a>
			</div>
			<div class="look_more" onclick="getMore()">
				<div class="txt">查看更多>></div>
			</div>
		</div>
		<input type="hidden" name="platform" value="{$platform}">
		<input type="hidden" name="game_id" value="{$game_id}">
		<input type="hidden" name="type" value="{$type}">
	</body>
	<script src="js/base64_a.js"></script>
	<script src="js/search.js"></script>
	<script src="js/getUrlParam.js"></script>
	<script>
		$(".type_one").click(function(){
            $(".select_textul").css("margin-left","0%")
        })
        $(".type_two").click(function(){
            $(".select_textul").css("margin-left","-100%!")
        })
        $(".type_three").click(function(){
            $(".select_textul").css("margin-left","-200%!")
        })
        $(".type_four").click(function(){
            $(".select_textul").css("margin-left","-300%!")
        })
	</script>
	<script>

        $(window).ready(function () {
            var name=UrlParm.parm("name");
            var id=UrlParm.parm("id");
            if(name=="link1"){
                $(".koudai").css("display","none")
			}
            if(name=="link2"){
                $(".moyu").css("display","none")
            };
        });
        var name="";  //设置服务输入框的值
        var serv_id;
        //点击搜索区服名字的得到对应的下面的li===============================================
		$(".search_txt_s2").click(function () {
		    var name1=$(".input_s").val();
		    var name2=$(".input_s2").val();
		    if($(".input_s").is(":hidden")){
		        name=name2;
			}else {
		        name=name1
			};
            $.ajax({
                url: "http://m.66173.com/moyu_product.php?act=get_game_servs_list",
                type: "GET",
                data: {
                    serv_name:name //只搜索出结果只传输入名
                },
                dataType: "text",
                success: function (res) {
                    console.log(res)
                    var json=$.parseJSON(base64decode(res.substr(1)));
                    if(json.code==1){
                        console.log(json.msg);
                    }else{
                        console.log(json.msg);
                    }
                }
            })
        });
        //==============================================
        $(".result_ul li").click(function () { //点击服务li获取相应的数据
			$(".fuwuqi_div").hide();
			var text=$(this).text();
            if($(this).text().length>3){
                var text=$(this).text().substring(0,3)+"...";
                $(".fuwuqi_select").html(text);
                console.log(text)
            }
           // serv_id=$(this).attr("data-id");
           console.log(serv_id)
            $.ajax({
                url: "http://m.66173.com/moyu_product.php?act=get_game_servs_list",
                type: "GET",
                data: {
                    serv_id:serv_id,  //传服务器id
                    serv_name:name
                },
                dataType: "text",
                success: function (res) {
                    console.log(res)
                    var json=$.parseJSON(base64decode(res.substr(1)));
                    if(json.code==1){
                        console.log(json.msg);
                    }else{
                       console.log(json.msg);
                    }
                }
            })
        })
        //=====================================================
        $(".all_service").click(function () { //点击两种渠道（id为3和4）获取相应的数据
			var channel_id=$(this).attr("data-id");
			console.log("渠道名id为"+channel_id);
            $.ajax({
                url: "moyu_product.php?act=get_channel_list",
                type: "GET",
                data: {
                    id:channel_id
                },
                dataType: "text",
                success: function (res) {
                    console.log(res)
                    var json=$.parseJSON(base64decode(res.substr(1)));
                    if(json.code==1){
                        console.log(json.msg);
                    }else{
                        console.log(json.msg);
                    }
                }
            })
        })
	//	点击服务器标题的时候默认穿id=3
		$(".search_title").click(function(){
            var channel_id=3;
            console.log(channel_id)
            $.ajax({
                url: "moyu_product.php?act=get_channel_list",
                type: "GET",
                data: {
                    id:3
                },
                dataType: "text",
                success: function (res) {
                    console.log(res)
                    var json=$.parseJSON(base64decode(res.substr(1)));
                    if(json.code==1){
                        console.log(json.msg);
                    }else{
                        console.log(json.msg);
                    }
                }
            })
		})
	//	假数据模拟
		function bianili(){
            var arr=[{"name":"熊志国","sex":"男","age":"13"},{"name":"熊志国","sex":"男","age":"13"},{"name":"熊志国","sex":"男","age":"13"}]
            var html2='';
            for(var i=0;i<arr.length;i++){
                html2+='<a class="game_list_item" href="goods_detail.html">'+
                    '<div class="game_list_item_l">'+
                    '<img class="game_list_item_l_box"  src="./image/index_image/icon.png" alt="">'+
                    '</div>'+
                    '<div class="game_list_item_c">'+
                    '<div class="game_list_item_c_s">'+
                    '<span class="chong_bg">'+arr[i].name+'</span>'+'充2000元带奖励可代续充'+
                    '</div>'+
                    '<div class="game_list_item_c_z">'+arr[i].sex+'|神域之光|魔域手游'+'</div>'+
                    '<div class="game_list_item_c_x">'+arr[i].sex+'</div>'+
                    '</div>'+
                    '</a>'
            }
            $(".game_list_list").html(html2)
        }
		$(document).ready(function(){
            bianili()
        })
	</script>
</html>
